﻿using System;
using System.Collections.Generic;
using Module.Core.Member;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Data;

namespace Web.Test.ConTrols
{
    public partial class DeleteMember : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            loadGridView();
        }
        protected void loadGridView()
        {
            TreeMemBer tree = new TreeMemBer();
            DataTable dt = null;
            dt = tree.getListMemBer();
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            TreeMemBer tree = new TreeMemBer();
            int dong = GridView1.SelectedIndex;
            String codeMember = GridView1.Rows[dong].Cells[1].Text;
            tree.deleteMember(codeMember);
            loadGridView();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            TreeMemBer tree = new TreeMemBer();
            tree.deleteMember();
            loadGridView();
        }
    }
}